import React, {useState} from "react";
import PhotoViewer from "@/components/page/PhotoPage/PhotoViewer.tsx";
import PhotoController from "@/components/page/PhotoPage/PhotoController.tsx";

const Index: React.FC = () => {
    const [containerIndex, setContainerIndex] = useState(-1)
    const [index, setIndex] = useState(-1)
    const [forceRender, setForceRender] = useState(Math.random())

    const setter = (containerIndex: number, index: number) => {
        setContainerIndex(containerIndex)
        setIndex(index)
        setForceRender(Math.random())
    }

    return (
        <div>
            <PhotoController setter={setter}
                             containerIndex={containerIndex}
                             index={index}/>
            <PhotoViewer containerIndex={containerIndex}
                         index={index}/>
        </div>
    )
}

export default Index;
